<template>
  <!-- 一条文章单元格 -->
  <van-cell>
    <!-- 标题区域的插槽 -->
    <template #title>
      <div class="title-box">
        <!-- 标题 -->
        <span>{{item.title}}</span>
        <!-- 一张图 -->
        <img  class="thumb" :src="item.cover.images[0]" v-if="item.cover.type===1">
        </div>
        <div class="thumb-box" v-if="item.cover.type>1">

            <!-- 三张图的容器 -->
              <!-- urlStr 图片地址字符串 -->
            <img  class="thumb" v-for="urlStr ,index in item.cover.images" :key="index" :src="urlStr" >

        </div>

    </template>
    <!-- label 区域的插槽 -->
    <template #label>
      <div class="label-box">
        <div>
          <span>作者{{item.aut_name}}&nbsp;&nbsp;</span>
          <span>{{item.comm_count}}评论&nbsp;&nbsp;</span>
          <span>{{item.pubdate}}</span>
        </div>
        <!-- 反馈按钮 -->
        <van-icon name="cross" />
      </div>
    </template>
  </van-cell>
</template>

<script>
export default {
  // 11=文章对象=================================
  props: {
    item: { // 文章对象
      type: Object,
      default () {
        return {}
      }
    }
  }
}
</script>

<style scoped lang="less">
/* 标题样式 */
.title-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* label描述样式 */
.label-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 图片的样式, 矩形黄金比例：0.618 */
.thumb {
  width: 113px;
  height: 70px;
  background-color: #f8f8f8;
  object-fit: cover;
}

/* 三图, 图片容器 */
.thumb-box {
  display: flex;
  justify-content: space-between;
}
</style>
